﻿@{
    Layout = "~/Views/Shared/_Layout.cshtml";
}


<div id="dictionaryListTable" class="main-content">
    <h3 class="page-title">数据字典管理Data dictionary management</h3>

    <div class="panel">
        <div class="panel-body">
            <button class="btn btn-primary" v-on:click="AddDictionary">
                <i class="fa fa-book"></i>  新增数据字典Newly added data dictionary
            </button>
            <br />
            <br />
            <table class="table table-striped" v-if="isNotEmptyObject(dictionaryList)">
                <thead>
                    <tr>
                        <th>ID</th>
                        <th>名称name</th>
                        <th>使用描述Usage description</th>
                        <th>字典值Dictionary value</th>
                        <th>数据值Data value</th>
                        <th>操作operation</th>
                    </tr>
                </thead>
                <tbody v-for="(dictionary, index) in dictionaryList">
                    <tr :id='"inputArea" + dictionary.ID'>
                        <td>
                            <div class="form-group">
                                <label class="form-control">{{dictionary.ID}}</label>
                                <input type="hidden" class="form-control" v-model="dictionary.ID" />
                            </div>
                        </td>
                        <td>
                            <div :id='"inputName" + dictionary.ID' class="form-group">
                                <input type="text" class="form-control" v-model="dictionary.Name" />
                            </div>
                        </td>
                        <td>
                            <div :id='"inputDescription" + dictionary.ID' class="form-group">
                                <input type="text" class="form-control" v-model="dictionary.Description" />
                            </div>
                        </td>
                        <td>
                            <div :id='"inputDKey" + dictionary.ID' class="form-group">
                                <input type="text" class="form-control" v-model="dictionary.DKey" />
                            </div>
                        </td>
                        <td>
                            <div :id='"inputDValue" + dictionary.ID' class="form-group">
                                <input type="text" class="form-control" v-model="dictionary.DValue" />
                            </div>
                        </td>
                        <td>
                            <button :id='"btnSave" + dictionary.ID' class="btn btn-success btn-sm" v-on:click="SaveDictionary(dictionary)" v-if="dictionary.ID == 0">
                                <i class="fa fa-save"></i> 保存preservation
                            </button>
                            <button :id='"btnCancelSave" + dictionary.ID' class="btn btn-warning btn-sm" v-on:click="CancelSaveDictionary(dictionary)" v-if="dictionary.ID == 0">
                                <i class="fa fa-close"></i> 取消cancel
                            </button>
                            <button :id='"btnEdit" + dictionary.ID' class="btn btn-info btn-sm" v-on:click="EditDictionary(dictionary)" v-if="dictionary.ID > 0">
                                <i class="fa fa-edit"></i> 编辑edit
                            </button>
                            <button :id='"btnUpdate" + dictionary.ID' class="btn btn-primary btn-sm" style="display: none;" v-on:click="UpdateDictionary(dictionary)">
                                <i class="fa fa-refresh"></i> 更新renew
                            </button>
                            <button :id='"btnCancelUpdate" + dictionary.ID' class="btn btn-warning btn-sm" style="display: none;" v-on:click="CancelUpdateDictionary(dictionary)">
                                <i class="fa fa-close"></i> 取消cancel
                            </button>
                            <button :id='"btnDelete" + dictionary.ID' class="btn btn-danger btn-sm" style="display: none;" v-on:click="DeleteDictionary(dictionary)">
                                <i class="fa fa-trash-o"></i> 删除delete
                            </button>
                        </td>
                    </tr>
                </tbody>
            </table>
        </div>
    </div>
    <!-- END TABLE -->
</div>


@section scripts{
    @Scripts.Render("~/Vue/System/Dictionary")
}
